package com.chengduservice.controller;

import com.chengduservice.dto.ReplyDto;
import com.chengduservice.service.ReplyService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * create by yongli on 2020-09-05 22:02
 */
@RestController
@Api("这是reply表操作")
@RequestMapping("/v1/reply")
public class ReplyController {
    @Autowired
    ReplyService replyService;

    // String和Integer区别
    @GetMapping("/{id}")
    public ReplyDto getById(@PathVariable("id") Integer id) {
        return replyService.getOneById(id);
    }

    @GetMapping("/test")
    public String test(@RequestParam("id") Integer id) {
        return "test is ok";
    }

}
